package jmine.tec.script.persistent;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum ScriptPersistenceMessages implements MessageCreator {
    DISPATCHER_DISPATCHER_NOT_FOUND(1, "jmine.tec.script.persistence.dispatcher.dispatcher.not.found"),

    VALIDATION_DIFFERENT_LANGUAGE_API(3, "jmine.tec.script.persistence.validation.different.language.api"),

    DRIVER_PREMATURE_EOF(0, "jmine.tec.script.driver.prematureEOF"),

    DISPATCHER_NOT_FOUND(1, "jmine.tec.script.persistence.dispatcher.not.found"),

    DOMAIN_IOEXCEPTION(0, "jmine.tec.script.domain.IOException"),

    VALIDATION_VARIABLE_USED_MULTIPLE_TIMES(3, "jmine.tec.script.persistence.validation.variable.used.multiple.times"),

    VALIDATION_BEAN_ADDED_MULTIPLE_TIMES(3, "jmine.tec.script.persistence.validation.bean.added.multiple.times"),

    DOMAIN_SQLEXCEPTION(0, "jmine.tec.script.domain.SQLException"),

    CLASS_NOT_FOUND(1, "jmine.tec.script.persistence.class.not.found"),

    SCRIPT_CONTEXT_DOES_NOT_MATCH(2, "jmine.tec.script.persistence.script.context.does.not.match"),

    INVALID_SCRIPT_SERVICE_IMPLEMENTATION(1, "jmine.tec.script.persistence.invalid.script.service.implementation"),

    DRIVER_IOEXCEPTION(0, "jmine.tec.script.driver.IOException"),

    PROCESSOR_PURPOSE_NOT_FOUND(1, "jmine.tec.script.persistence.processor.purpose.not.found"),

    DISPATCHER_WRONG_CONTEXT_CLASS(1, "jmine.tec.script.persistence.dispatcher.wrong.context.class"),

    ERROR_CREATING_CONTEXT(0, "jmine.tec.script.persistence.error.creating.context"),

    VALIDATION_SCRIPT_IS_NOT_API(2, "jmine.tec.script.persistence.validation.script.is.not.api");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private ScriptPersistenceMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-script-persistence-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
